DevJourney

Python/VIT/sem-1/ex-14/4. String contains web address/String contains web address.py

import re

s = input("Enter statement: ")
res = re.findall(r'(https?://(?:[-\w.]|(?:%[\da-fA-F]{2}))+)', s)
if res:
    print("Valid web address : ",res,)
else:
    print("Not a valid web address!")
View on GitHub